package com.anycc.cloud.core.service;

import com.anycc.cloud.common.dto.easyui.Tree;
import com.anycc.cloud.common.dto.query.PagingRequest;
import com.anycc.cloud.common.dto.query.PagingResponse;
import com.anycc.cloud.core.entity.Org;

import java.util.List;

/**
 * org service
 */
public interface OrgService {
    /**
     * create org
     *
     * @param org org
     * @return Org
     */
    Org create(Org org);

    /**
     * delete org by id
     *
     * @param id org id
     */
    void delete(String id);

    /**
     * find org by id
     *
     * @param id id
     * @return Org
     */
    Org findById(String id);

    /**
     * update org
     *
     * @param org org
     * @return Org
     */
    Org update(Org org);

    /**
     * paging query
     *
     * @param org           org
     * @param pagingRequest PagingRequest
     * @return PagingResponse
     */
    PagingResponse<Org> findByPaging(Org org, PagingRequest pagingRequest);

    /**
     * build org tree
     *
     * @return List
     */
    List<Tree> tree();

    /**
     * build tree
     *
     * @param orgId org id
     * @return List
     */
    List<Tree> parentTree(String orgId);
}
